﻿<UserControl x:Class="VSTalk.Engine.View.HistoryExplorerControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:windows="clr-namespace:VSTalk.Engine.ViewModel.History"
             xmlns:behaviours="clr-namespace:VSTalk.Engine.Utils"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0"
                    Grid.ColumnSpan="2"
                    Orientation="Horizontal">
            <TextBlock Text="Conversation with " />
            <TextBlock Text="{Binding With}" />
        </StackPanel>
        
        <TreeView Grid.Row="1"
                  Grid.Column="0"
                  ItemsSource="{Binding HistoryView}"
                  behaviours:TreeViewHelper.SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}">
            <TreeView.Resources>
                <HierarchicalDataTemplate DataType="{x:Type windows:HistoryView}"
                                          ItemsSource="{Binding ActiveDates}">
                    <TextBlock Text="{Binding Month}" />
                </HierarchicalDataTemplate>
                <HierarchicalDataTemplate DataType="{x:Type windows:DayMessageView}">
                    <TextBlock Text="{Binding Day}" />
                </HierarchicalDataTemplate>
                
            </TreeView.Resources>
            
        </TreeView>
        <GridSplitter Grid.Row="1"
                          Grid.Column="0"
                          HorizontalAlignment="Right"
                          VerticalAlignment="Stretch"
                          ResizeDirection="Columns" Width="3" />
        <ContentControl Grid.Row="1"
                        Grid.Column="1"
                        Content="{Binding HistoryMessages}"  />
        
    </Grid>
</UserControl>
